package com.chhh.cranelease.controller.financialmanagement;

import com.chhh.cranelease.entity.Base;
import com.chhh.cranelease.model.ResponseCode;
import com.chhh.cranelease.service.FinancialManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("finace/")
public class BaseController {

    @Autowired
    private FinancialManagementService financialManagementService;

    private ResponseCode responseCode = new ResponseCode();

    @RequestMapping("selectAllBase")
    public List<Base> selectAllBase(){
        return financialManagementService.selectAllBase();
    }
    @RequestMapping("updateBase")
    public ResponseCode updateBase(Base base){
        Integer bases = financialManagementService.updateBase(base);
        responseCode.setStatus("你修改了"+bases+"条记录");
        responseCode.setErrorCode(0);
        return responseCode;
    }
}
